﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace Zove.Desktop.Tools
{
    public partial class AddAnExecutableForm : Form
    {
        public string Label
        {
            get
            {
                return this.tbLabel.Text;
            }
            set
            {
                this.tbLabel.Text = value;
            }
        }

        public string FileName
        {
            get
            {
                return this.tbFileName.Text;
            }
            set
            {
                this.tbFileName.Text = value;
            }
        }

        public AddAnExecutableForm()
        {
            InitializeComponent();
        }

        private void btnFind_Click(object sender, EventArgs e)
        {
            OpenFileDialog f = new OpenFileDialog();

            if (f.ShowDialog() == DialogResult.OK)
            {
                this.tbFileName.Text = f.FileName;
            }
        }

        private void btnOk_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(this.tbLabel.Text) || string.IsNullOrEmpty(this.tbFileName.Text)) {
                MessageBox.Show("Please enter both the program file and its label.");
            }

            this.Close();
        }
    }
}
